﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ListFilter.ascx.cs"
    Inherits="Workflow.Alerts.Sublayouts.ListFilter" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<div id="filter" runat="server" class="filterContainer">
    <div class="filterOptions">
        <div id="datefilters" runat="server" visible="true" class="datefilters">
            <span class="rowBoxLabel">Melding datums</span>
            <asp:DropDownList ID="ddlDate" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlDate_SelectedIndexChanged"
                CssClass="js_hiddenDropdown hiddenDropdown styledDropdown220" />
            <div class="clear"></div>
            <asp:UpdatePanel ID="upDates" runat="server" UpdateMode="Always">
                <ContentTemplate>
                    <div runat="server" id="fromdate" class="boxRow">
                        <span class="radioButton">
                            <asp:CheckBox ID="chkFromDate" runat="server" OnCheckedChanged="chkFromDate_CheckedChanged"
                                AutoPostBack="True" />
                            <asp:Label ID="Label2" AssociatedControlID="chkFromDate" Text="Van" runat="server"></asp:Label>
                        </span>
                        <telerik:RadDatePicker ID="rdpFromDate" runat="server" AutoPostBack="True" OnSelectedDateChanged="rdpFromDate_SelectedDateChanged"
                            Enabled="false" EnableEmbeddedBaseStylesheet="False" EnableEmbeddedSkins="False"
                            Skin="workflow">
                            <Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x">
                            </Calendar>
                            <DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
                            <DateInput DisplayDateFormat="d-M-yyyy" DateFormat="d-M-yyyy" AutoPostBack="True">
                            </DateInput>
                        </telerik:RadDatePicker>
                        <div class="clear"></div>
                    </div>
                    <div runat="server" id="todate" class="boxRow">
                        <span class="radioButton">
                            <asp:CheckBox ID="chkToDate" runat="server" OnCheckedChanged="chkToDate_CheckedChanged"
                                AutoPostBack="True" />
                            <asp:Label ID="Label1" AssociatedControlID="chkToDate" Text="Tot" runat="server"></asp:Label>
                        </span>
                        <telerik:RadDatePicker ID="rdpToDate" runat="server" AutoPostBack="True" OnSelectedDateChanged="rdpToDate_SelectedDateChanged"
                            Enabled="false" EnableEmbeddedBaseStylesheet="False" EnableEmbeddedSkins="False"
                            Skin="workflow">
                            <Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x">
                            </Calendar>
                            <DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
                            <DateInput DisplayDateFormat="d-M-yyyy" DateFormat="d-M-yyyy" AutoPostBack="True">
                            </DateInput>
                        </telerik:RadDatePicker>
                        <div class="clear"></div>
                    </div>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="ddlDate" EventName="SelectedIndexChanged" />
                    <asp:AsyncPostBackTrigger ControlID="rdpFromDate" EventName="SelectedDateChanged" />
                    <asp:AsyncPostBackTrigger ControlID="rdpToDate" EventName="SelectedDateChanged" />
                    <asp:AsyncPostBackTrigger ControlID="chkFromDate" EventName="CheckedChanged" />
                    <asp:AsyncPostBackTrigger ControlID="chkToDate" EventName="CheckedChanged" />
                </Triggers>
            </asp:UpdatePanel>
        </div>
        <div class="filterCheckboxes">
            <div id="alerttype" runat="server" visible="false" class="floatLeft checkboxContainer">
                <span class="rowBoxLabel">Type melding</span>
                <asp:CheckBoxList ID="chkAlertType" runat="server" EnableViewState="true">
                </asp:CheckBoxList>
            </div>
            <div id="activitytype" runat="server" visible="false" class="floatLeft checkboxContainer">
                <span class="rowBoxLabel">Type activiteit</span>
                <asp:CheckBoxList ID="chkActivityType" runat="server" EnableViewState="true">
                </asp:CheckBoxList>
            </div>
            <div id="networkoperatorname" runat="server" visible="false" class="floatLeft checkboxContainer">
                <span class="rowBoxLabel">Netwerkbeheerder</span>
                <asp:CheckBoxList ID="chkNetworkOperator" runat="server" EnableViewState="true">
                </asp:CheckBoxList>
            </div>
            <div id="municipalityname" runat="server" visible="false" class="floatLeft checkboxContainer">
                <span class="rowBoxLabel">Gemeente</span>
                <asp:CheckBoxList ID="chkMunicipality" runat="server" EnableViewState="true">
                </asp:CheckBoxList>
            </div>
            
        </div>
        <div class="filterCheckboxes">
            <div id="status" runat="server" visible="true" class="floatLeft checkboxContainer">
                <span class="rowBoxLabel">Status</span>
                <asp:CheckBoxList ID="chkStatus" runat="server" EnableViewState="true">
                </asp:CheckBoxList>
            </div>
			<div id="herstel" runat="server" visible="false" class="floatLeft checkboxContainer">
                <span class="rowBoxLabel">Gedeeltelijk<br /> herstel</span>
                <span class="radioButton">
					<asp:CheckBox ID="chkHerstel" runat="server" EnableViewState="true" Text="Ja">
	                </asp:CheckBox>
                </span>
            </div>
			<div class="filterComboBox" id="contractors" runat="server" visible="false">
                <span class="rowBoxLabel">Uitvoerder</span>
				<asp:DropDownList ID="ddlContractors" runat="server" CssClass="hiddenDropdown js_hiddenDropdown styledDropdown styledDropdown160"></asp:DropDownList>
			</div>
        </div>
    </div>
    <div class="buttons floatRight">
        <div class="updEraseFilter">
            <asp:UpdatePanel ID="updEraseFilter" runat="server">
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="btnEraseFilter" EventName="Click" />
                </Triggers>
            </asp:UpdatePanel>
        </div>
        <asp:Button ID="btnApply" runat="server" Text="Filter toepassen" OnClick="btnApply_Click"
            class="styledButton styledButton150 submit js_submit" />
        <asp:Button ID="btnEraseFilter" runat="server" Text="Filter wissen" OnClick="btnEraseFilter_Click"
            CssClass="eraseFilter js_eraseFilter styledButton styledButton150" />
        <input id="btnCancel" type="button" value="Annuleren" class="cancel js_cancel styledButton styledButton75" />
    </div>
</div>
<div class="overlay">
</div>

<script type="text/javascript">
	workflow.filter.Init()
	workflow.form.radioButtonCtrl.SetupLabel()
    jQuery(document).ready(function() {
        workflow.form.select.Init("select.js_hiddenDropdown:not(.init)");
    });
    
    jQuery('form').submit( function() {
        parent.workflow.postfilter()
    });
    
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequest);
    function EndRequest(sender, args) {
        workflow.form.radioButtonCtrl.SetupLabel();
        jQuery("a.rcCalPopup").not(".rcDisabled").click(function(){
            setTimeout(function(){
                jQuery(".overlay").fadeIn("fast");
                var docWidth = jQuery(document).width();
                var calWidth = jQuery(".RadCalendar_workflow").width();
                var leftOffset = (docWidth - calWidth)/2;
                jQuery(".RadCalendarPopup").css({
                    "left":leftOffset,
                    "top":"30px"
                });            
            },50);
        });
        jQuery(".overlay, .rcMainTable tbody td").click(function(){
            jQuery(".overlay, .RadCalendarPopup").fadeOut("fast");
        });
    }
</script>

<span class="js_loaded"></span>